package rest.jbpm.wrappers.lists;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rest.jbpm.wrappers.Duration;


@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "durations", propOrder = {
    "durations"})
public class DurationList {
	private List<Duration> durations;
	private static final Logger log = LoggerFactory.getLogger(DeploymentList.class);
	
	protected DurationList() {
		
	}
	
	public DurationList(Map<String,Number> drtns) {
		
		durations = new ArrayList<Duration>();
		
		for(String activity : drtns.keySet())
			durations.add(new Duration(activity, drtns.get(activity)));

	}
	
	@XmlElement(name="durations",required=true)
	public List<Duration> getDurations() {
		return durations;
	}
}
